<form id="pagerForm" method="post" action="{:U($module_name.'/'.$action_name."?model=".$model)}">
    <input type="hidden" name="pageNum" value="{$pageNum}" />
    <input type="hidden" name="numPerPage" value="{$numPerPage}" />
    <input type="hidden" name="orderField" value="{$orderField}" />
    <input type="hidden" name="orderDirection" value="{$orderDirection}" />
	<input type='hidden' name='listkey' value='{$listkey}' />
	<input type='hidden' name='keywords' value='{$keywords}' />
	<input type='hidden' name='sfield' value='{$sfield}' />
	<input type="hidden" name="sfield_name" value="name" />	
</form>
<div class="pageHeader">
    <form rel="pagerForm" onsubmit="return navTabSearch(this);" action="{:U($module_name.'/'.$action_name)}" method="post">
        <input type='hidden' name='listkey' value='{$listkey}' />
		<div class="searchBar">
            <ul class="searchContent">
                <li style="width:200px;">
                <label style="width: 50px;">关键字：</label>
                <input type="text" name="keywords" value="{$keywords}"/>
                </li>
                <li style="width: 100px;">
                <select class="combox" name="sfield">
                	<option value="all" >全部</option>
                	<option value="pc.id" >ID</option>
                    <option value="name" >商品名称</option>
                </select>
				<input type="hidden" name="sfield_name" value="pc.id,name" />					
                </li>
				<!--	
				<li>
					状态：
					<select name="status">
						<option value='1' selected>进行中</option>
						<option value='0'>已结束</option>
					</select>
				</li>
				-->
                <li style="padding-top:0;"><div class="buttonActive"><div class="buttonContent"><button type="submit">搜索</button></div></div></li>
            </ul>
        </div>
    </form>
</div>
<div class="pageContent">
	<div class="panelBar">
		<ul class="toolBar">
			<li><a title="确实要删除这些记录吗?" target="selectedTodo" rel="ids[]" href="{:U('Sales/delete')}" class="delete"><span>批量删除</span></a></li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="113">
		<thead>
			<tr>	
				<th width="25"><input type="checkbox" group="ids[]" class="checkboxCtrl"></th>	
				<th>ID</th>
				<th>产品ID</th>
				<th>产品图片</th>		
				<th orderField="name" {if $orderField=='name'}class="{$orderDirection}"{/if}>产品名称</th>			
				<th>类型</th>
				<th orderField="value" {if $orderField=='value'}class="{$orderDirection}"{/if}>数值</th>
				<th orderField="status" {if $orderField=='status'}class="{$orderDirection}"{/if}>状态</th>
				<th orderField="number" {if $orderField=='number'}class="{$orderDirection}"{/if}>优惠数量限制</th>
				<th orderField="starttime" {if $orderField=='starttime'}class="{$orderDirection}"{/if}>开始时间</th>
				<th orderField="endtime" {if $orderField=='endtime'}class="{$orderDirection}"{/if}>结束时间</th>
				<th>优惠说明</th>
				<th orderField="frequency" {if $orderField=='frequency'}class="{$orderDirection}"{/if}>可以使用的次数</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			<volist name="list" id="vo">
			<tr target="sid_user" rel="9" style="height:40px;">		
				<td><input name="ids[]" value="{$vo['id']}" type="checkbox" class="type"></td>
				<td>{$vo['id']}</td>	
				<td>{$vo['product_id']}</td>	
				<td><img width="40" height="40" src="{$vo['image']|addrimage}"></td>		
				<td width='400px;'><a title="查看" target="dialog" width="880" height="650" rel="Content_show_{$vo['id']}" href="{:U('Content/show',array('id'=>$vo['product_id']))}">{$vo.name}</a> </td>				
				<td>{$vo.subject}</td>
				<td><font color='red'>{$vo['value']/100}</font> </td>
				<td>{if $vo['status']}<font color='green'>进行中</font>{else}已结束{/if}</td>
				<td>{$vo.number}</td>
				<td>{if $vo['starttime']}{$vo.starttime|date='Y-m-d H:i:s',###}{else}不限制{/if}</td>
				<td>{if $vo['endtime']}{$vo.endtime|date='Y-m-d H:i:s',###}{else}不限制{/if}</td>
				<td width='300px;'>{$vo.remark}</td>
				<td>{if $vo['frequency']}{$vo.frequency}{else}不限制{/if}</td>
				<td >
					{if $vo['status']}
					{if $listkey == 'ju'}<a class="btnjhs" href="{:U('Sales/over',array('id'=>$vo['id']))}" target="ajaxTodo" title="确定结束秒杀？">巨</a>
					{else} <a href="{:U('Sales/over',array('id'=>$vo['id']))}" target="ajaxTodo" title="确定结束秒杀？">结束</a>
					{/if}
					<a class="btnEdit" href="{:U('Sales/edit',array('id'=>$vo['id'],'proid'=>$vo['product_id'],'listkey'=>$listkey))}" target="dialog" width="650" height="680" title="编辑">编辑</a>
			
					{/if}
					<a class="btnDel" href="{:U('Sales/delete',array('id'=>$vo['id'],'proid'=>$vo['product_id'],'listkey'=>$listkey))}" target="ajaxTodo" title="确定删除？">删除</a>
				</td>
			</tr>
			</volist>
		</tbody>
	</table>
	<include file="Index:pages" />
</div>
<script type="text/javascript">
function set_param(obj, id, type, model){
	var obj = $(obj).prev();
	$.ajax({
		type: "POST",
		url: "{:U('Product/set_param')}",
		data: 'id='+id+'&type='+type+'&value='+obj.val()+'&model='+model,
		dataType:'json',
		success: function(msg){
			alertMsg.info('修改成功！');
			if ( type == 'image' )
				if ( obj.val() ) obj.val(0);
				else obj.val(1);
		}
	});
}

$(function(){
	
});
</script>
